﻿@{
	Layout = null;
}
<!DOCTYPE html>
<html>
<head>
	<base target="_self" />
	<title>@ViewBag.Title</title>
	@RazorWidget.ViewStart()
	@{
		var error = TempData["Error"];
		var message = TempData["Message"];
	}
	<script type="text/javascript">
		$(function () {

			/* 系统提示 或者 系统错误
			----------------------------------------------------------*/
			if ('@error' != "")
				window.setTimeout("window.top.sysAlert('@error')", 500);
			if ('@message' != "")
				window.top.sysMessage('@message');

			/* 导航内容
			----------------------------------------------------------*/
			var navigation = $.trim($(window.top.document).find(".menu-active").text()) + ">>" + $.trim($(window.top.document).find(".navigation").text());
			$("form").append("<input type='hidden' name='navigation' value='" + navigation + "' />");
		});
	</script>
</head>
<body style="display: none;">
	<div>
		@RenderBody()
	</div>
	<div id="alert" style="display: none">
	</div>
</body>
<script type="text/javascript">
	$("body").fadeIn("slow");
	var edit = @((int)Project.Common.EnumPageState.编辑);
	var create = @((int)Project.Common.EnumPageState.新增);
	var detail = @((int)Project.Common.EnumPageState.查看);
</script>
@if (ViewBag.PageState != null && ((Project.Common.EnumPageState)ViewBag.PageState).ToString() == Project.Common.EnumPageState.查看.ToString())
{
	<script type="text/javascript">
		$(function () {
			$("input[type='submit'][class='button']").css("display", "none");
			$("input[type='button'][value!='关闭']").attr("disabled", "disabled");
			$("input[type='checkbox']").attr("disabled", "disabled");
			$("input[type='text']").each(function () {
				var textValue = $(this).val();
				$(this).replaceWith(textValue);
			});
			$("input[type='file']").each(function () {
				var textValue = $(this).val();
				$(this).remove();
			});
			$("textarea").each(function () {
				var textValue = $(this).val();
				$(this).replaceWith(textValue);
			});
			$("select").each(function () {
				var selectValue = $(this).find("option:selected").text();
				if (selectValue == "-- 请选择 --")
					selectValue = "";
				$(this).replaceWith(selectValue);
			});
			$("input[type='password']").each(function () {
				$(this).parent().html("**********");
			});
		}
		);
	</script>
}
</html>
